from celery import shared_task
import time
# 记录日志：
import logging
logger = logging.getLogger("django")

@shared_task(name="send_message")
def sendmessage(to,content):
    print("向"+to+"发送邮件..."+content)
    time.sleep(5)
    print("发送完成")

from utils.send import send_message
#新建异步任务
@shared_task(name='send')
def sendmsg(phone,code):
    #就是管着发短信a
    return send_message(phone,code)